
                    <svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
                        <path stroke-linecap="round" d="M5,0 0,2.5 5,5z" id="raphael-marker-block" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></path>
                    </svg>
                    <blockquote> 
 <p><strong>高级的题库更新之后，专业性更强了，不是真正从事这一行的，很难做出来。本人就是个小菜鸡，有一些题，我也不想不明白。题目的答案我尽可能的找到出处，如果读者发现错误或有补充建议，欢迎评论或私信笔者。笔者这篇就当抛砖引玉，各位读者可以当作考试的一个参考</strong></p> 
</blockquote> 
<h4><a name="t0"></a><a id="HarmonyOShttpsblogcsdnnetGusha_articledetails140072321spm1001201430015502_5"></a>基础认证题库请移步：<a href="https://blog.csdn.net/Gusha_/article/details/140072321?spm=1001.2014.3001.5502" target="_blank">HarmonyOS应用开发者基础认证题库</a></h4> 
<hr> 
<h3><a name="t1"></a><a id="20_8"></a><code style="user-select: auto;">注：有读者反馈，题库的代码块比较多，打开文章时会卡死。所以笔者将题库拆分，以20道题为一组，题库目录如下，读者可以按需跳转。如果对您的阅读产生不便，笔者在这里向大家说声抱歉，请各位读者原谅。该题库已整理完毕，笔者不再更新。笔者连续考了三次，都过了，所以答案应该没什么太大问题。有需要题库文档的可以自取。祝各位读者好运(๑¯ω¯๑)。</code></h3> 
<h2><a name="t2"></a><a id="_10"></a>序号目录：</h2> 
<ul><li>单选题<br> <a href="https://blog.csdn.net/Gusha_/article/details/140295266?spm=1001.2014.3001.5502" target="_blank">HarmonyOS应用开发者高级认证，Next版本发布后最新题库 - 单选题序号1</a><br> <a href="https://blog.csdn.net/Gusha_/article/details/140580616?spm=1001.2014.3001.5501" target="_blank">HarmonyOS应用开发者高级认证，Next版本发布后最新题库 - 单选题序号2</a><br> <a href="https://blog.csdn.net/Gusha_/article/details/140580633?spm=1001.2014.3001.5501" target="_blank">HarmonyOS应用开发者高级认证，Next版本发布后最新题库 - 单选题序号3</a><br> <a href="https://blog.csdn.net/Gusha_/article/details/140617294" target="_blank">HarmonyOS应用开发者高级认证，Next版本发布后最新题库 - 单选题序号4</a><br> <a href="https://blog.csdn.net/Gusha_/article/details/140749409?spm=1001.2014.3001.5502" target="_blank">HarmonyOS应用开发者高级认证，Next版本发布后最新题库 - 单选题序号5</a></li><li>多选题<br> <a href="https://blog.csdn.net/Gusha_/article/details/140580653?spm=1001.2014.3001.5501" target="_blank">HarmonyOS应用开发者高级认证，Next版本发布后最新题库 - 多选题序号1</a><br> <a href="https://blog.csdn.net/Gusha_/article/details/140580668?spm=1001.2014.3001.5501" target="_blank">HarmonyOS应用开发者高级认证，Next版本发布后最新题库 - 多选题序号2</a><br> <a href="https://blog.csdn.net/Gusha_/article/details/140613052?spm=1001.2014.3001.5502" target="_blank">HarmonyOS应用开发者高级认证，Next版本发布后最新题库 - 多选题序号3</a></li><li>答案纯享版<br> <a href="https://blog.csdn.net/Gusha_/article/details/140676104?spm=1001.2014.3001.5502" target="_blank">HarmonyOS应用开发者高级认证，Next版本发布后最新题库 - 答案纯享版</a></li></ul> 
<hr> 
<h4><a name="t3"></a><a id="httpspanbaiducoms153tDk4dVv_MmLEyzOqW9hQpwdxkgr_24"></a>题库文档链接（自取）：https://pan.baidu.com/s/153tDk4dVv_MmLEyzOqW9hQ?pwd=xkgr</h4> 
<hr> 
<h2><a name="t4"></a><a id="_27"></a>注：题目是乱序，每次考试，选项的顺序都不同</h2> 
<h3><a name="t5"></a><a id="_09_093_29"></a>多选题题库 - 序号3</h3> 
<hr> 
<p>41、以下关于Localstorage的说法正确有哪些？</p> 
<p>​ A、LocalStorage中的所有属性都是<a href="https://so.csdn.net/so/search?q=%E4%B8%8D%E5%8F%AF%E5%8F%98%E7%9A%84&amp;spm=1001.2101.3001.7020" target="_blank" class="hl hl-1" data-report-view="{&quot;spm&quot;:&quot;1001.2101.3001.7020&quot;,&quot;dest&quot;:&quot;https://so.csdn.net/so/search?q=%E4%B8%8D%E5%8F%AF%E5%8F%98%E7%9A%84&amp;spm=1001.2101.3001.7020&quot;,&quot;extra&quot;:&quot;{\&quot;searchword\&quot;:\&quot;不可变的\&quot;}&quot;}" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.7020&quot;,&quot;dest&quot;:&quot;https://so.csdn.net/so/search?q=%E4%B8%8D%E5%8F%AF%E5%8F%98%E7%9A%84&amp;spm=1001.2101.3001.7020&quot;,&quot;extra&quot;:&quot;{\&quot;searchword\&quot;:\&quot;不可变的\&quot;}&quot;}" data-tit="不可变的" data-pretit="不可变的">不可变的</a>。</p> 
<p>​ <code style="user-select: auto;">B、被@Component装饰的组件最多可以访问一个LocalStorage实例和AppStorage，未被@Entry装饰的组件不可被独立分配LocalStorage实例，只能接受父组件的LocalStorage实例。</code></p> 
<p>​ <code style="user-select: auto;">C、组件树的根节点，即被@Entry装饰的@Component，可以被分配一个LocalStorage实例， 此组件的所有子组件实例将自动获得对该LocalStorage实例的访问权限。</code></p> 
<p>​ <code style="user-select: auto;">D、应用程序可以创建多个LocalStorage实例，LocalStorage实例可以在页面内共享，也可以通过GetShared接口，获取在UIAbility里创建的GetShared，实现跨页面、UIAbility内共享 。</code></p> 
<p><a href="https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/arkts-localstorage-V5" rel="nofollow" target="_blank">LocalStorage：页面级UI状态存储-管理应用拥有的状态-状态管理（V1稳定版）-状态管理-学习ArkTS语言-基础入门 | 华为开发者联盟 (huawei.com)</a></p> 
<hr> 
<p>42、在基于Stage模型开发的应用项目代码下，每个模块都存在一个module.json5配置文件，用于配置模块的基本信息，以下module.json5配置文件正确的是</p> 
<pre data-index="0" class="set-code-show prettyprint" style="user-select: auto;"><code class="prism language-typescript has-numbering" onclick="mdcp.copyCode(event)" style="position: unset; user-select: auto;"><span class="token comment">//	A	</span>
<span class="token punctuation">{<!-- --></span>
	<span class="token string-property property">"module"</span><span class="token operator">:</span> <span class="token punctuation">{<!-- --></span>
		<span class="token string-property property">"name"</span><span class="token operator">:</span> <span class="token string">"bName"</span><span class="token punctuation">,</span>
		<span class="token string-property property">"type"</span><span class="token operator">:</span><span class="token string">" shared"</span><span class="token punctuation">,</span>
		<span class="token string-property property">"deviceTypes"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
			<span class="token string">"default"</span><span class="token punctuation">,</span>
			<span class="token string">"tablet"</span>
		<span class="token punctuation">]</span><span class="token punctuation">,</span>
		<span class="token string-property property">"deliveryWithInstall"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
		<span class="token string-property property">"pages"</span><span class="token operator">:</span> <span class="token string">"$profile:main_pages"</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
<div class="hljs-button {2} add_def" data-title="复制"></div></code><ul class="pre-numbering" style="opacity: 0.924133;"><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li><li style="color: rgb(153, 153, 153);">9</li><li style="color: rgb(153, 153, 153);">10</li><li style="color: rgb(153, 153, 153);">11</li><li style="color: rgb(153, 153, 153);">12</li><li style="color: rgb(153, 153, 153);">13</li></ul><button class="btn-code-notes mdeditor" data-report-click="{&quot;spm&quot;:&quot;3001.10436&quot;,&quot;extra&quot;:{&quot;index&quot;:0,&quot;runIdx&quot;:-1}}">代码解读</button></pre> 
<pre data-index="1" class="set-code-show prettyprint" style="user-select: auto;"><code class="prism language-typescript has-numbering" onclick="mdcp.copyCode(event)" style="position: unset; user-select: auto;"><span class="token comment">//	B	==	缺少字段【deliveryWithInstall】</span>
<span class="token punctuation">{<!-- --></span>
	<span class="token string-property property">"module"</span><span class="token operator">:</span> <span class="token punctuation">{<!-- --></span>
		<span class="token string-property property">"name"</span><span class="token operator">:</span> <span class="token string">"aName"</span><span class="token punctuation">,</span>
		<span class="token string-property property">"type"</span><span class="token operator">:</span> <span class="token string">"har"</span>
		<span class="token string-property property">"deviceTypes"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
		<span class="token string">"default"</span><span class="token punctuation">,</span> <span class="token string">"tablet"</span> <span class="token punctuation">]</span>
	<span class="token punctuation">}</span>
<span class="token punctuation">}</span>
<div class="hljs-button {2} add_def" data-title="复制"></div></code><ul class="pre-numbering" style="opacity: 0.924133;"><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li><li style="color: rgb(153, 153, 153);">9</li></ul><button class="btn-code-notes mdeditor" data-report-click="{&quot;spm&quot;:&quot;3001.10436&quot;,&quot;extra&quot;:{&quot;index&quot;:1,&quot;runIdx&quot;:-1}}">代码解读</button></pre> 
<pre data-index="2" class="set-code-show prettyprint" style="user-select: auto;"><code class="prism language-typescript has-numbering" onclick="mdcp.copyCode(event)" style="position: unset; user-select: auto;"><span class="token comment">//	C	==	【type】字段不支持【hsp】</span>
<span class="token punctuation">{<!-- --></span>
	<span class="token string-property property">"module"</span><span class="token operator">:</span> <span class="token punctuation">{<!-- --></span>
    	<span class="token string-property property">"name"</span><span class="token operator">:</span> <span class="token string">"cName"</span><span class="token punctuation">,</span>
		<span class="token string-property property">"type"</span><span class="token operator">:</span> <span class="token string">"hsp"</span><span class="token punctuation">,</span>
		<span class="token string-property property">"description"</span><span class="token operator">:</span> <span class="token string">"$string:desc"</span><span class="token punctuation">,</span>
		<span class="token string-property property">"deviceTypes"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
			<span class="token string">"default"</span><span class="token punctuation">,</span>
			<span class="token string">"tablet"</span>
		<span class="token punctuation">]</span><span class="token punctuation">,</span>
		<span class="token string-property property">"deliveryWithInstal1"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
		<span class="token string-property property">"pages"</span><span class="token operator">:</span> <span class="token string">"$profile:main_pages"</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
<div class="hljs-button {2} add_def" data-title="复制"></div></code><ul class="pre-numbering" style="opacity: 0.924133;"><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li><li style="color: rgb(153, 153, 153);">9</li><li style="color: rgb(153, 153, 153);">10</li><li style="color: rgb(153, 153, 153);">11</li><li style="color: rgb(153, 153, 153);">12</li><li style="color: rgb(153, 153, 153);">13</li><li style="color: rgb(153, 153, 153);">14</li></ul><button class="btn-code-notes mdeditor" data-report-click="{&quot;spm&quot;:&quot;3001.10436&quot;,&quot;extra&quot;:{&quot;index&quot;:2,&quot;runIdx&quot;:-1}}">代码解读</button></pre> 
<pre data-index="3" class="prettyprint set-code-show" style="user-select: auto;"><code class="prism language-typescript has-numbering" onclick="mdcp.copyCode(event)" style="position: unset; user-select: auto;"><span class="token comment">//	D</span>
<span class="token punctuation">{<!-- --></span>
	<span class="token string-property property">"module"</span><span class="token operator">:</span> <span class="token punctuation">{<!-- --></span>
		<span class="token string-property property">"name"</span><span class="token operator">:</span> <span class="token string">"application"</span><span class="token punctuation">,</span>
		<span class="token string-property property">"type"</span><span class="token operator">:</span> <span class="token string">"feature"</span><span class="token punctuation">,</span>
		<span class="token string-property property">"description"</span><span class="token operator">:</span> <span class="token string">"$string:module_desc"</span><span class="token punctuation">,</span>
		<span class="token string-property property">"mainElement"</span><span class="token operator">:</span> <span class="token string">"ApplicationAbility"</span><span class="token punctuation">,</span>
		<span class="token string-property property">"deviceTypes"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
			<span class="token string">"default"</span><span class="token punctuation">,</span>
			<span class="token string">"tablet"</span>
		<span class="token punctuation">]</span><span class="token punctuation">,</span>
		<span class="token string-property property">"deliverywithInstall"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
		<span class="token string-property property">"installationFree"</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
		<span class="token string-property property">"pages"</span><span class="token operator">:</span> <span class="token string">"$profile:main_pages"</span><span class="token punctuation">,</span>
		<span class="token string-property property">"abilities"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
            <span class="token punctuation">{<!-- --></span>
				<span class="token string-property property">"name"</span><span class="token operator">:</span> <span class="token string">"ApplicationAbility"</span><span class="token punctuation">,</span>
				<span class="token string-property property">"srcEntry"</span><span class="token operator">:</span> <span class="token string">"./ets/applicationability/ApplicationAbility.ets"</span><span class="token punctuation">,</span> 
				<span class="token string-property property">"description"</span><span class="token operator">:</span> <span class="token string">"$string:ApplicationAbility_desc"</span><span class="token punctuation">,</span>
				<span class="token string-property property">"icon"</span><span class="token operator">:</span> <span class="token string">"$media:icon"</span><span class="token punctuation">,</span>
				<span class="token string-property property">"label"</span><span class="token operator">:</span> <span class="token string">"$string:ApplicationAbility_label"</span><span class="token punctuation">,</span>
				<span class="token string-property property">"startwindowIcon"</span><span class="token operator">:</span> <span class="token string">"$media:startIcon"</span><span class="token punctuation">,</span>
				<span class="token string-property property">"startWindowBackground"</span><span class="token operator">:</span> <span class="token string">"$color:start_window_background"</span><span class="token punctuation">,</span>
				<span class="token string-property property">"exported"</span><span class="token operator">:</span> <span class="token boolean">true</span>
			<span class="token punctuation">}</span>
		<span class="token punctuation">]</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
<div class="hljs-button {2} add_def" data-title="复制"></div></code><ul class="pre-numbering" style="opacity: 0.924133;"><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li><li style="color: rgb(153, 153, 153);">9</li><li style="color: rgb(153, 153, 153);">10</li><li style="color: rgb(153, 153, 153);">11</li><li style="color: rgb(153, 153, 153);">12</li><li style="color: rgb(153, 153, 153);">13</li><li style="color: rgb(153, 153, 153);">14</li><li style="color: rgb(153, 153, 153);">15</li><li style="color: rgb(153, 153, 153);">16</li><li style="color: rgb(153, 153, 153);">17</li><li style="color: rgb(153, 153, 153);">18</li><li style="color: rgb(153, 153, 153);">19</li><li style="color: rgb(153, 153, 153);">20</li><li style="color: rgb(153, 153, 153);">21</li><li style="color: rgb(153, 153, 153);">22</li><li style="color: rgb(153, 153, 153);">23</li><li style="color: rgb(153, 153, 153);">24</li><li style="color: rgb(153, 153, 153);">25</li><li style="color: rgb(153, 153, 153);">26</li><li style="color: rgb(153, 153, 153);">27</li><li style="color: rgb(153, 153, 153);">28</li></ul><button class="btn-code-notes mdeditor" data-report-click="{&quot;spm&quot;:&quot;3001.10436&quot;,&quot;extra&quot;:{&quot;index&quot;:3,&quot;runIdx&quot;:-1}}">代码解读</button></pre> 
<p>​ <code style="user-select: auto;">A、A</code></p> 
<p>​ B、B</p> 
<p>​ C、C</p> 
<p>​ <code style="user-select: auto;">D、D</code></p> 
<p><a href="https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/module-configuration-file-V5#%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6%E6%A0%87%E7%AD%BE" rel="nofollow" target="_blank">module.json5配置文件-应用配置文件（Stage模型）-开发基础知识-基础入门 | 华为开发者联盟 (huawei.com)</a></p> 
<hr> 
<p>43、hiAppEvent提供的Watcher接口，订阅到的系统事件，哪些包含HiLog日志？</p> 
<p>​ A、CPU高负载事件</p> 
<p>​ B、启动耗时事件</p> 
<p>​ <code style="user-select: auto;">C、卡死事件</code></p> 
<p>​ <code style="user-select: auto;">D、崩溃事件</code></p> 
<p><a href="https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/hiappevent-watcher-cpu-usage-high-event-V5" rel="nofollow" target="_blank">CPU高负载事件介绍-CPU高负载事件-系统事件-事件订阅-HiAppEvent使用指导-Performance Analysis Kit（性能分析服务）-调测调优-系统 | 华为开发者联盟 (huawei.com)</a></p> 
<p><a href="https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/hiappevent-watcher-app-launch-event-V5" rel="nofollow" target="_blank">启动耗时事件介绍-启动耗时事件-系统事件-事件订阅-HiAppEvent使用指导-Performance Analysis Kit（性能分析服务）-调测调优-系统 | 华为开发者联盟 (huawei.com)</a></p> 
<p><a href="https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/hiappevent-watcher-freeze-events-V5" rel="nofollow" target="_blank">卡死事件介绍-卡死事件-系统事件-事件订阅-HiAppEvent使用指导-Performance Analysis Kit（性能分析服务）-调测调优-系统 | 华为开发者联盟 (huawei.com)</a></p> 
<p><a href="https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/hiappevent-watcher-crash-events-V5" rel="nofollow" target="_blank">崩溃事件介绍-崩溃事件-系统事件-事件订阅-HiAppEvent使用指导-Performance Analysis Kit（性能分析服务）-调测调优-系统 | 华为开发者联盟 (huawei.com)</a></p> 
<hr> 
<p>44、当前动态import支持导入的模块类型有哪些？</p> 
<p>​ <code style="user-select: auto;">A、动态import支持加载OHPM模块</code></p> 
<p>​ <code style="user-select: auto;">B、动态import支持加载本地HAR模块</code></p> 
<p>​ <code style="user-select: auto;">C、动态import支持加载HSP模块</code></p> 
<p>​ <code style="user-select: auto;">D、动态import支持加载远程HAR模块</code></p> 
<p><a href="https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/arkts-dynamic-import-V5#%E5%8A%A8%E6%80%81import%E5%AE%9E%E7%8E%B0%E6%96%B9%E6%A1%88%E4%BB%8B%E7%BB%8D" rel="nofollow" target="_blank">动态import-应用程序包开发与使用-应用程序包基础知识-开发基础知识-基础入门 | 华为开发者联盟 (huawei.com)</a></p> 
<hr> 
<p>45、ArkTS是<span class="edu-hl hl hl-1" data-report-view="{&quot;spm&quot;:&quot;1001.2101.3001.7020&quot;,&quot;extra&quot;:&quot;{\&quot;word\&quot;:\&quot;鸿蒙生态\&quot;}&quot;}" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.7020&quot;,&quot;extra&quot;:&quot;{\&quot;word\&quot;:\&quot;鸿蒙生态\&quot;}&quot;}" data-tit="鸿蒙生态" data-pretit="鸿蒙生态">鸿蒙生态</span>的应用开发语言。以下哪些选项是ArkTS的设计理念。(我感觉【satety】打错了，应该是【safety】)</p> 
<p>​ <code style="user-select: auto;">A、通过规范强化静态检查和分析，减少运行时的类型检查，从而降低了运行时负载，提升执行性能。</code></p> 
<p>​ <code style="user-select: auto;">B、通过规范强化静态检查和分析， 使得许多错误在编译时可以被检测出来，降低代码运行错误的风险。</code></p> 
<p>​ C、ArkTS不支持null-satety特性 。</p> 
<p>​ <code style="user-select: auto;">D、ArkTS保留 了TS大部分的语法特性，帮助开发者更容易上手ArkTS。</code></p> 
<hr> 
<p>46、以下代码片段哪几处违反了ArkTS语法规范。</p> 
<pre data-index="4" class="set-code-show prettyprint" style="user-select: auto;"><code class="prism language-typescript has-numbering" onclick="mdcp.copyCode(event)" style="position: unset; user-select: auto;"><span class="token keyword">function</span> <span class="token function">foo</span><span class="token punctuation">(</span>value<span class="token operator">:</span> <span class="token builtin">number</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
  <span class="token keyword">return</span> value<span class="token punctuation">;</span>
<span class="token punctuation">}</span>

<span class="token function">foo</span><span class="token punctuation">(</span><span class="token string">''</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token function">foo</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token function">foo</span><span class="token punctuation">(</span><span class="token keyword">undefined</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token function">foo</span><span class="token punctuation">(</span><span class="token keyword">null</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<div class="hljs-button {2} add_def" data-title="复制"></div></code><ul class="pre-numbering" style="opacity: 0.924133;"><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li></ul><button class="btn-code-notes mdeditor" data-report-click="{&quot;spm&quot;:&quot;3001.10436&quot;,&quot;extra&quot;:{&quot;index&quot;:4,&quot;runIdx&quot;:-1}}">代码解读</button></pre> 
<p>​ <code style="user-select: auto;">A. foo(null);</code></p> 
<p>​ <code style="user-select: auto;">B. foo(undefined);</code></p> 
<p>​ <code style="user-select: auto;">C. foo(");</code></p> 
<p>​ D.foo(0);</p> 
<hr> 
<p><strong>47、以下哪些是可以在Navigation中使用pushPathByName接口传递的params的参数类型（不确定，把所有选项列出）</strong></p> 
<p>​ <code style="user-select: auto;">A、arrayBuffer</code></p> 
<p>​ <strong>B、map&lt;string,string&gt;</strong></p> 
<p>​ <code style="user-select: auto;">C、record&lt;string,string&gt;</code></p> 
<p>​ <code style="user-select: auto;">D、string</code></p> 
<hr> 
<p><strong>48、HSP支持导出ArkUl组件、接口，供应用内的其他HAP/HSP引用，下面正确的是（不确定，把所有选项列出）</strong></p> 
<pre data-index="5" class="prettyprint set-code-show" style="user-select: auto;"><code class="prism language-typescript has-numbering" onclick="mdcp.copyCode(event)" style="position: unset; user-select: auto;"><span class="token comment">//	A</span>

<span class="token comment">//  library/src/main/ets/components/MyTitleBar.ets</span>
<span class="token decorator"><span class="token at operator">@</span><span class="token function">Component</span></span>
<span class="token keyword">export</span> struct MyTitleBar <span class="token punctuation">{<!-- --></span>
  <span class="token function">build</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
    <span class="token function">Row</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
      <span class="token function">Text</span><span class="token punctuation">(</span><span class="token function">$r</span><span class="token punctuation">(</span><span class="token string">'app.string.library_title'</span> <span class="token punctuation">)</span><span class="token punctuation">)</span>
        <span class="token punctuation">.</span><span class="token function">id</span><span class="token punctuation">(</span><span class="token string">'library'</span><span class="token punctuation">)</span>
        <span class="token punctuation">.</span><span class="token function">fontFamily</span><span class="token punctuation">(</span><span class="token string">'HarmonyHeiTi'</span><span class="token punctuation">)</span>
        <span class="token punctuation">.</span><span class="token function">fontWeight</span><span class="token punctuation">(</span>FontWeight<span class="token punctuation">.</span>Bold<span class="token punctuation">)</span>
        <span class="token punctuation">.</span><span class="token function">fontSize</span><span class="token punctuation">(</span><span class="token number">32</span><span class="token punctuation">)</span>
        <span class="token punctuation">.</span><span class="token function">fontColor</span><span class="token punctuation">(</span><span class="token function">$r</span><span class="token punctuation">(</span><span class="token string">'app.color.text_color'</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
    <span class="token punctuation">}</span>
    <span class="token punctuation">.</span><span class="token function">width</span><span class="token punctuation">(</span><span class="token string">'100%'</span><span class="token punctuation">)</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
<span class="token comment">//	对外暴露的接口，需要在入口文件index.ets中声明:</span>
<span class="token comment">//	library/index.ets</span>
<span class="token keyword">export</span> <span class="token punctuation">{<!-- --></span> MyTitleBar <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'./src/main/ets/components/MyTitleBar'</span><span class="token punctuation">;</span>
<div class="hljs-button {2} add_def" data-title="复制"></div></code><ul class="pre-numbering" style="opacity: 0.924133;"><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li><li style="color: rgb(153, 153, 153);">9</li><li style="color: rgb(153, 153, 153);">10</li><li style="color: rgb(153, 153, 153);">11</li><li style="color: rgb(153, 153, 153);">12</li><li style="color: rgb(153, 153, 153);">13</li><li style="color: rgb(153, 153, 153);">14</li><li style="color: rgb(153, 153, 153);">15</li><li style="color: rgb(153, 153, 153);">16</li><li style="color: rgb(153, 153, 153);">17</li><li style="color: rgb(153, 153, 153);">18</li><li style="color: rgb(153, 153, 153);">19</li><li style="color: rgb(153, 153, 153);">20</li></ul><button class="btn-code-notes mdeditor" data-report-click="{&quot;spm&quot;:&quot;3001.10436&quot;,&quot;extra&quot;:{&quot;index&quot;:5,&quot;runIdx&quot;:-1}}">代码解读</button></pre> 
<pre data-index="6" class="set-code-show prettyprint" style="user-select: auto;"><code class="prism language-typescript has-numbering" onclick="mdcp.copyCode(event)" style="position: unset; user-select: auto;"><span class="token comment">//	B</span>

<span class="token comment">//  library/src/main/ets/utils/nativeTest.ts</span>
<span class="token keyword">import</span> native <span class="token keyword">from</span> <span class="token string">'liblibrary.so'</span><span class="token punctuation">;</span>
<span class="token keyword">export</span> <span class="token keyword">function</span> <span class="token function">nativeMulti</span><span class="token punctuation">(</span>a<span class="token operator">:</span> <span class="token builtin">number</span><span class="token punctuation">,</span> b<span class="token operator">:</span> <span class="token builtin">number</span><span class="token punctuation">)</span><span class="token operator">:</span> <span class="token builtin">number</span> <span class="token punctuation">{<!-- --></span>
  <span class="token keyword">let</span> result<span class="token operator">:</span> <span class="token builtin">number</span> <span class="token operator">=</span> native<span class="token punctuation">.</span><span class="token function">multi</span><span class="token punctuation">(</span>a<span class="token punctuation">,</span> b<span class="token punctuation">)</span><span class="token punctuation">;</span>
  <span class="token keyword">return</span> result<span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token comment">//  对外暴露的接口，需要在入口文件index.ets中声明:</span>
<span class="token comment">//  library/index.ets</span>
<span class="token keyword">export</span> <span class="token punctuation">{<!-- --></span> nativeMulti <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'./ src/main/ets/utils/nativeTest'</span><span class="token punctuation">;</span>
<div class="hljs-button {2} add_def" data-title="复制"></div></code><ul class="pre-numbering" style="opacity: 0.924133;"><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li><li style="color: rgb(153, 153, 153);">9</li><li style="color: rgb(153, 153, 153);">10</li><li style="color: rgb(153, 153, 153);">11</li></ul><button class="btn-code-notes mdeditor" data-report-click="{&quot;spm&quot;:&quot;3001.10436&quot;,&quot;extra&quot;:{&quot;index&quot;:6,&quot;runIdx&quot;:-1}}">代码解读</button></pre> 
<pre data-index="7" class="prettyprint set-code-show" style="user-select: auto;"><code class="prism language-typescript has-numbering" onclick="mdcp.copyCode(event)" style="position: unset; user-select: auto;"><span class="token comment">//  C</span>

<span class="token comment">//  library/src/main/ets/utils/test.ts</span>
<span class="token keyword">export</span> <span class="token keyword">class</span> <span class="token class-name">Log</span> <span class="token punctuation">{<!-- --></span>
  <span class="token keyword">static</span> <span class="token function">info</span><span class="token punctuation">(</span>msg<span class="token operator">:</span> <span class="token builtin">string</span><span class="token punctuation">)</span><span class="token operator">:</span> <span class="token keyword">void</span> <span class="token punctuation">{<!-- --></span>
    <span class="token builtin">console</span><span class="token punctuation">.</span><span class="token function">info</span><span class="token punctuation">(</span>msg<span class="token punctuation">)</span><span class="token punctuation">;</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
<span class="token keyword">export</span> <span class="token keyword">function</span> <span class="token function">add</span><span class="token punctuation">(</span>a<span class="token operator">:</span> <span class="token builtin">number</span><span class="token punctuation">,</span> b<span class="token operator">:</span> <span class="token builtin">number</span><span class="token punctuation">)</span><span class="token operator">:</span> <span class="token builtin">number</span> <span class="token punctuation">{<!-- --></span>
  <span class="token keyword">return</span> a <span class="token operator">+</span> b<span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token keyword">export</span> <span class="token keyword">function</span> <span class="token function">minus</span><span class="token punctuation">(</span>a<span class="token operator">:</span> <span class="token builtin">number</span><span class="token punctuation">,</span> b<span class="token operator">:</span> <span class="token builtin">number</span><span class="token punctuation">)</span><span class="token operator">:</span> <span class="token builtin">number</span> <span class="token punctuation">{<!-- --></span>
  <span class="token keyword">return</span> a <span class="token operator">-</span> b<span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token comment">//  对外暴露的接口，需要在入口文件index.ets中声明:</span>
<span class="token comment">//  library/index.ets</span>
<span class="token keyword">export</span> <span class="token punctuation">{<!-- --></span> Log<span class="token punctuation">,</span> add<span class="token punctuation">,</span> minus <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'./src/main/ets/utils/test'</span><span class="token punctuation">;</span>
<div class="hljs-button {2} add_def" data-title="复制"></div></code><ul class="pre-numbering" style="opacity: 0.924133;"><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li><li style="color: rgb(153, 153, 153);">9</li><li style="color: rgb(153, 153, 153);">10</li><li style="color: rgb(153, 153, 153);">11</li><li style="color: rgb(153, 153, 153);">12</li><li style="color: rgb(153, 153, 153);">13</li><li style="color: rgb(153, 153, 153);">14</li><li style="color: rgb(153, 153, 153);">15</li><li style="color: rgb(153, 153, 153);">16</li><li style="color: rgb(153, 153, 153);">17</li></ul><button class="btn-code-notes mdeditor" data-report-click="{&quot;spm&quot;:&quot;3001.10436&quot;,&quot;extra&quot;:{&quot;index&quot;:7,&quot;runIdx&quot;:-1}}">代码解读</button></pre> 
<p>​ <code style="user-select: auto;">A、导出ArkUI组件</code></p> 
<p>​ <code style="user-select: auto;">B、导出native方法，在HSP中也可以包含C++编写的so。对于so中的native方法，HSP通过间接的方式导出，以导出liblibrary.so的乘法接口multi为例</code></p> 
<p>​ <code style="user-select: auto;">C、导出ts类和方法</code></p> 
<p><a href="https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/in-app-hsp-V5#%E5%AF%BC%E5%87%BAarkui%E7%BB%84%E4%BB%B6" rel="nofollow" target="_blank">HSP-应用程序包开发与使用-应用程序包基础知识-开发基础知识-基础入门 | 华为开发者联盟 (huawei.com)</a></p> 
<hr> 
<p>49、下面关于方舟字节码文件格式描述正确的是</p> 
<p>​ A、方舟字节码文件中数据类型uint32_t表示32-bit无符号整数，采用大端字节序</p> 
<p>​ B、方舟字节码文件中不包含字节码文件内容的adler32校验和</p> 
<p>​ <code style="user-select: auto;">C、方舟字节码文件是ArkTS/TS/JS编译后的二进制产物</code></p> 
<p>​ <code style="user-select: auto;">D、方舟字节码文件中数据类型uint16_t表示16-bit无符号整数，采用小端字节序</code></p> 
<p><a href="https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/arkts-bytecode-file-format-V5" rel="nofollow" target="_blank">方舟字节码文件格式-学习ArkTS语言-基础入门 | 华为开发者联盟 (huawei.com)</a></p> 
<hr> 
<p>50、在开发HarmonyOS应用的多元化测试环境中，DevEco Studio引入了本地模拟器(Local Emulator)作为重要工具，旨在帮助开发者在个人开发机器上高效模拟HarmonyOS环境，进行应用或服务的快速运行与细致调试。请根据本地模拟器的实际应用场景与系统要求，选出所有正确的描述选项</p> 
<p>​ A、开发者需要注意的是，DevEco Studio的本地模拟器可以在<span class="words-blog hl-git-1" data-report-view="{&quot;spm&quot;:&quot;1001.2101.3001.10283&quot;,&quot;extra&quot;:&quot;{\&quot;words\&quot;:\&quot;虚拟机\&quot;}&quot;}" data-tit="虚拟机" data-pretit="虚拟机">虚拟机</span>内部进一步运行，以节省硬件资源。</p> 
<p>​ <code style="user-select: auto;">B、为了保证流畅的运行和调试体验，本地模拟器推荐macOS系统版本至少为12.5以上。</code></p> 
<p>​ <code style="user-select: auto;">C、DevEco Studio的本地模拟器允许开发者在个人电脑上模拟HarmonyOS环境，便于应用或服务的运行与调试。</code></p> 
<p>​ <code style="user-select: auto;">D、mac计算机配置方面，为了确保本地模拟器的稳定运行，推荐至少配备8GB RAM。</code></p> 
<p><a href="https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/ide-emulator-requirements-0000001839717622-V5" rel="nofollow" target="_blank">使用环境-概述-使用模拟器运行应用/服务-应用/服务运行-DevEco Studio | 华为开发者联盟 (huawei.com)</a></p> 
<hr> 
<p>51、下面关于混淆的描述正确的是</p> 
<p>​ <code style="user-select: auto;">A、支持顶层作用域名称、 属性名称、文件名称等多种混淆功能</code></p> 
<p>​ <code style="user-select: auto;">B、修改应用混淆配置，新配置需要重新全量编译应用才能生效</code></p> 
<p>​ <code style="user-select: auto;">C、在工程build-profile.json5中的obfuscation.ruleOptions.files字段中配置该工程的混淆配置，该配置仅在编译该工程时生 效。</code></p> 
<p>​ <code style="user-select: auto;">D、可以在HAR模块工程的build-profile.json5中的obfuscation.consumerFiles字段中配置导出的混淆配置，该配置仅在编译 依赖该HAR的模块时生效。</code></p> 
<p><a href="https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/source-obfuscation-V5#%E4%BB%A3%E7%A0%81%E6%B7%B7%E6%B7%86%E7%AE%80%E4%BB%8B" rel="nofollow" target="_blank">代码混淆-ArkTS（方舟编程语言）-应用框架 | 华为开发者联盟 (huawei.com)</a></p> 
<hr> 
<p>52、如下哪些方式可实现图片动态播放？</p> 
<pre data-index="8" class="prettyprint set-code-show" style="user-select: auto;"><code class="prism language-typescript has-numbering" onclick="mdcp.copyCode(event)" style="position: unset; user-select: auto;"><span class="token comment">//	A</span>
<span class="token keyword">import</span> <span class="token punctuation">{<!-- --></span>AnimationOptions<span class="token punctuation">,</span> AnimatedDrawableDescriptor<span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'@ohos.arkui.drawableDescriptor'</span>
<span class="token keyword">import</span> image <span class="token keyword">from</span> <span class="token string">'@ohos.multimedia.image'</span>

<span class="token decorator"><span class="token at operator">@</span><span class="token function">Entry</span></span>
<span class="token decorator"><span class="token at operator">@</span><span class="token function">Component</span></span>
struct ImageExample <span class="token punctuation">{<!-- --></span>
  pixelmaps<span class="token operator">:</span> <span class="token builtin">Array</span><span class="token operator">&lt;</span>PixelMap<span class="token operator">&gt;</span> <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
  options<span class="token operator">:</span> AnimationOptions <span class="token operator">=</span> <span class="token punctuation">{<!-- --></span>duration<span class="token operator">:</span><span class="token number">2000</span><span class="token punctuation">,</span> iterations<span class="token operator">:</span><span class="token number">1</span><span class="token punctuation">}</span><span class="token punctuation">;</span>
  <span class="token decorator"><span class="token at operator">@</span><span class="token function">State</span></span> animated<span class="token operator">:</span> AnimatedDrawableDescriptor <span class="token operator">|</span> <span class="token keyword">undefined</span> <span class="token operator">=</span> <span class="token keyword">undefined</span><span class="token punctuation">;</span>

  <span class="token keyword">async</span> <span class="token function">aboutToAppear</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
    <span class="token keyword">this</span><span class="token punctuation">.</span>pixelmaps <span class="token operator">=</span> <span class="token keyword">await</span> <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">getPixelMaps</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token keyword">this</span><span class="token punctuation">.</span>animated <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">AnimatedDrawableDescriptor</span><span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">.</span>pixelmaps<span class="token punctuation">,</span> <span class="token keyword">this</span><span class="token punctuation">.</span>options<span class="token punctuation">)</span><span class="token punctuation">;</span>
  <span class="token punctuation">}</span>

  <span class="token function">build</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
    <span class="token function">Column</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
      <span class="token function">Row</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
        <span class="token function">Image</span><span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">.</span>animated<span class="token punctuation">)</span>
          <span class="token punctuation">.</span><span class="token function">width</span><span class="token punctuation">(</span><span class="token string">'500px'</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">height</span><span class="token punctuation">(</span><span class="token string">'280px'</span><span class="token punctuation">)</span>
      <span class="token punctuation">}</span><span class="token punctuation">.</span><span class="token function">height</span><span class="token punctuation">(</span><span class="token string">'50%'</span><span class="token punctuation">)</span>
      <span class="token function">Row</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
        <span class="token function">Button</span><span class="token punctuation">(</span><span class="token string">'once'</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">width</span><span class="token punctuation">(</span><span class="token number">100</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">padding</span><span class="token punctuation">(</span><span class="token number">5</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">onClick</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{<!-- --></span>
          <span class="token keyword">this</span><span class="token punctuation">.</span>options <span class="token operator">=</span> <span class="token punctuation">{<!-- --></span>duration<span class="token operator">:</span><span class="token number">2000</span><span class="token punctuation">,</span> iterations<span class="token operator">:</span><span class="token number">1</span><span class="token punctuation">}</span><span class="token punctuation">;</span>
          <span class="token keyword">this</span><span class="token punctuation">.</span>animated <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">AnimatedDrawableDescriptor</span><span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">.</span>pixelmaps<span class="token punctuation">,</span> <span class="token keyword">this</span><span class="token punctuation">.</span>options<span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">margin</span><span class="token punctuation">(</span><span class="token number">5</span><span class="token punctuation">)</span>
      <span class="token punctuation">}</span>
    <span class="token punctuation">}</span><span class="token punctuation">.</span><span class="token function">width</span><span class="token punctuation">(</span><span class="token string">'50%'</span><span class="token punctuation">)</span>
  <span class="token punctuation">}</span>

  <span class="token keyword">private</span> <span class="token keyword">async</span> <span class="token function">getPixmapFromMedia</span><span class="token punctuation">(</span>resource<span class="token operator">:</span> Resource<span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
    <span class="token keyword">let</span> unit8Array <span class="token operator">=</span> <span class="token keyword">await</span> <span class="token function">getContext</span><span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">)</span><span class="token operator">?.</span>resourceManager<span class="token operator">?.</span><span class="token function">getMediaContent</span><span class="token punctuation">(</span><span class="token punctuation">{<!-- --></span>
      bundleName<span class="token operator">:</span> resource<span class="token punctuation">.</span>bundleName<span class="token punctuation">,</span>
      moduleName<span class="token operator">:</span> resource<span class="token punctuation">.</span>moduleName<span class="token punctuation">,</span>
      id<span class="token operator">:</span> resource<span class="token punctuation">.</span>id
    <span class="token punctuation">}</span><span class="token punctuation">)</span>
    <span class="token keyword">let</span> imageSource <span class="token operator">=</span> image<span class="token punctuation">.</span><span class="token function">createImageSource</span><span class="token punctuation">(</span>unit8Array<span class="token punctuation">.</span>buffer<span class="token punctuation">.</span><span class="token function">slice</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span> unit8Array<span class="token punctuation">.</span>buffer<span class="token punctuation">.</span>byteLength<span class="token punctuation">)</span><span class="token punctuation">)</span>
    <span class="token keyword">let</span> createPixelMap<span class="token operator">:</span> image<span class="token punctuation">.</span>PixelMap <span class="token operator">=</span> <span class="token keyword">await</span> imageSource<span class="token punctuation">.</span><span class="token function">createPixelMap</span><span class="token punctuation">(</span><span class="token punctuation">{<!-- --></span>
      desiredPixelFormat<span class="token operator">:</span> image<span class="token punctuation">.</span>PixelMapFormat<span class="token punctuation">.</span><span class="token constant">RGBA_8888</span>
    <span class="token punctuation">}</span><span class="token punctuation">)</span>
    <span class="token keyword">await</span> imageSource<span class="token punctuation">.</span><span class="token function">release</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
    <span class="token keyword">return</span> createPixelMap
  <span class="token punctuation">}</span>

  <span class="token keyword">private</span> <span class="token keyword">async</span> <span class="token function">getPixelMaps</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>   
    <span class="token comment">//	====================	怎么没有定义Mypixelmaps？？？？？？？？</span>
    Mypixelmaps<span class="token punctuation">.</span><span class="token function">push</span><span class="token punctuation">(</span><span class="token keyword">await</span> <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">getPixmapFromMedia</span><span class="token punctuation">(</span><span class="token function">$r</span><span class="token punctuation">(</span><span class="token string">'app.media.icon'</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token comment">//对应资源图片名后缀为png</span>
    <span class="token keyword">return</span> Mypixelmaps<span class="token punctuation">;</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
<div class="hljs-button {2} add_def" data-title="复制"></div></code><ul class="pre-numbering" style="opacity: 0.924133;"><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li><li style="color: rgb(153, 153, 153);">9</li><li style="color: rgb(153, 153, 153);">10</li><li style="color: rgb(153, 153, 153);">11</li><li style="color: rgb(153, 153, 153);">12</li><li style="color: rgb(153, 153, 153);">13</li><li style="color: rgb(153, 153, 153);">14</li><li style="color: rgb(153, 153, 153);">15</li><li style="color: rgb(153, 153, 153);">16</li><li style="color: rgb(153, 153, 153);">17</li><li style="color: rgb(153, 153, 153);">18</li><li style="color: rgb(153, 153, 153);">19</li><li style="color: rgb(153, 153, 153);">20</li><li style="color: rgb(153, 153, 153);">21</li><li style="color: rgb(153, 153, 153);">22</li><li style="color: rgb(153, 153, 153);">23</li><li style="color: rgb(153, 153, 153);">24</li><li style="color: rgb(153, 153, 153);">25</li><li style="color: rgb(153, 153, 153);">26</li><li style="color: rgb(153, 153, 153);">27</li><li style="color: rgb(153, 153, 153);">28</li><li style="color: rgb(153, 153, 153);">29</li><li style="color: rgb(153, 153, 153);">30</li><li style="color: rgb(153, 153, 153);">31</li><li style="color: rgb(153, 153, 153);">32</li><li style="color: rgb(153, 153, 153);">33</li><li style="color: rgb(153, 153, 153);">34</li><li style="color: rgb(153, 153, 153);">35</li><li style="color: rgb(153, 153, 153);">36</li><li style="color: rgb(153, 153, 153);">37</li><li style="color: rgb(153, 153, 153);">38</li><li style="color: rgb(153, 153, 153);">39</li><li style="color: rgb(153, 153, 153);">40</li><li style="color: rgb(153, 153, 153);">41</li><li style="color: rgb(153, 153, 153);">42</li><li style="color: rgb(153, 153, 153);">43</li><li style="color: rgb(153, 153, 153);">44</li><li style="color: rgb(153, 153, 153);">45</li><li style="color: rgb(153, 153, 153);">46</li><li style="color: rgb(153, 153, 153);">47</li><li style="color: rgb(153, 153, 153);">48</li><li style="color: rgb(153, 153, 153);">49</li><li style="color: rgb(153, 153, 153);">50</li><li style="color: rgb(153, 153, 153);">51</li></ul><button class="btn-code-notes mdeditor" data-report-click="{&quot;spm&quot;:&quot;3001.10436&quot;,&quot;extra&quot;:{&quot;index&quot;:8,&quot;runIdx&quot;:-1}}">代码解读</button></pre> 
<pre data-index="9" class="prettyprint set-code-show" style="user-select: auto;"><code class="prism language-typescript has-numbering" onclick="mdcp.copyCode(event)" style="position: unset; user-select: auto;"><span class="token comment">//	B</span>
<span class="token keyword">import</span> <span class="token punctuation">{<!-- --></span>AnimationOptions<span class="token punctuation">,</span> AnimatedDrawableDescriptor<span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'@ohos.arkui.drawableDescriptor'</span>
<span class="token keyword">import</span> image <span class="token keyword">from</span> <span class="token string">'@ohos.multimedia.image'</span>

<span class="token decorator"><span class="token at operator">@</span><span class="token function">Entry</span></span>
<span class="token decorator"><span class="token at operator">@</span><span class="token function">Component</span></span>
struct ImageExample <span class="token punctuation">{<!-- --></span>
  pixelmaps<span class="token operator">:</span> <span class="token builtin">Array</span><span class="token operator">&lt;</span>PixelMap<span class="token operator">&gt;</span> <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
  options<span class="token operator">:</span> AnimationOptions <span class="token operator">=</span> <span class="token punctuation">{<!-- --></span> duration<span class="token operator">:</span> <span class="token number">2000</span><span class="token punctuation">,</span> iterations<span class="token operator">:</span> <span class="token number">1</span> <span class="token punctuation">}</span><span class="token punctuation">;</span>
  <span class="token decorator"><span class="token at operator">@</span><span class="token function">State</span></span> animated<span class="token operator">:</span> AnimatedDrawableDescriptor <span class="token operator">|</span> <span class="token keyword">undefined</span> <span class="token operator">=</span> <span class="token keyword">undefined</span><span class="token punctuation">;</span>

  <span class="token keyword">async</span> <span class="token function">aboutToAppear</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
    <span class="token keyword">this</span><span class="token punctuation">.</span>pixelmaps <span class="token operator">=</span> <span class="token keyword">await</span> <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">getPixelMaps</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token keyword">this</span><span class="token punctuation">.</span>animated <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">AnimatedDrawableDescriptor</span><span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">.</span>pixelmaps<span class="token punctuation">,</span> <span class="token keyword">this</span><span class="token punctuation">.</span>options<span class="token punctuation">)</span><span class="token punctuation">;</span>
  <span class="token punctuation">}</span>

  <span class="token function">build</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
    <span class="token function">Column</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
      <span class="token function">Row</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
        <span class="token function">Image</span><span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">.</span>animated<span class="token punctuation">)</span>
          <span class="token punctuation">.</span><span class="token function">width</span><span class="token punctuation">(</span><span class="token string">'500px'</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">height</span><span class="token punctuation">(</span><span class="token string">'280px'</span><span class="token punctuation">)</span>
      <span class="token punctuation">}</span><span class="token punctuation">.</span><span class="token function">height</span><span class="token punctuation">(</span><span class="token string">'50%'</span><span class="token punctuation">)</span>

      <span class="token function">Row</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
        <span class="token function">Button</span><span class="token punctuation">(</span><span class="token string">'once'</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">width</span><span class="token punctuation">(</span><span class="token number">100</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">padding</span><span class="token punctuation">(</span><span class="token number">5</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">onClick</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{<!-- --></span>
          <span class="token keyword">this</span><span class="token punctuation">.</span>options <span class="token operator">=</span> <span class="token punctuation">{<!-- --></span> duration<span class="token operator">:</span> <span class="token number">2000</span><span class="token punctuation">,</span> iterations<span class="token operator">:</span> <span class="token number">1</span> <span class="token punctuation">}</span><span class="token punctuation">;</span>
          <span class="token keyword">this</span><span class="token punctuation">.</span>animated <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">AnimatedDrawableDescriptor</span><span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">.</span>pixelmaps<span class="token punctuation">,</span> <span class="token keyword">this</span><span class="token punctuation">.</span>options<span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">margin</span><span class="token punctuation">(</span><span class="token number">5</span><span class="token punctuation">)</span>
      <span class="token punctuation">}</span>
    <span class="token punctuation">}</span><span class="token punctuation">.</span><span class="token function">width</span><span class="token punctuation">(</span><span class="token string">'50%'</span><span class="token punctuation">)</span>
  <span class="token punctuation">}</span>

  <span class="token keyword">private</span> <span class="token keyword">async</span> <span class="token function">getPixmapListFromMedia</span><span class="token punctuation">(</span>resource<span class="token operator">:</span> Resource<span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
    <span class="token keyword">let</span> unit8Array <span class="token operator">=</span> <span class="token keyword">await</span> <span class="token function">getContext</span><span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">)</span><span class="token operator">?.</span>resourceManager<span class="token operator">?.</span><span class="token function">getMediaContent</span><span class="token punctuation">(</span><span class="token punctuation">{<!-- --></span>
      bundleName<span class="token operator">:</span> resource<span class="token punctuation">.</span>bundleName<span class="token punctuation">,</span>
      moduleName<span class="token operator">:</span> resource<span class="token punctuation">.</span>moduleName<span class="token punctuation">,</span>
      id<span class="token operator">:</span> resource<span class="token punctuation">.</span>id
    <span class="token punctuation">}</span><span class="token punctuation">)</span>
    <span class="token keyword">let</span> imageSource <span class="token operator">=</span> image<span class="token punctuation">.</span><span class="token function">createImageSource</span><span class="token punctuation">(</span>unit8Array<span class="token punctuation">.</span>buffer<span class="token punctuation">.</span><span class="token function">slice</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span> unit8Array<span class="token punctuation">.</span>buffer<span class="token punctuation">.</span>byteLength<span class="token punctuation">)</span><span class="token punctuation">)</span>
    <span class="token keyword">let</span> createPixelMap<span class="token operator">:</span> <span class="token builtin">Array</span><span class="token operator">&lt;</span>image<span class="token punctuation">.</span>PixelMap<span class="token operator">&gt;</span> <span class="token operator">=</span> <span class="token keyword">await</span> imageSource<span class="token punctuation">.</span><span class="token function">createPixelMapList</span><span class="token punctuation">(</span><span class="token punctuation">{<!-- --></span>
      desiredPixelFormat<span class="token operator">:</span> image<span class="token punctuation">.</span>PixelMapFormat<span class="token punctuation">.</span><span class="token constant">RGBA_8888</span>
    <span class="token punctuation">}</span><span class="token punctuation">)</span>
    <span class="token keyword">await</span> imageSource<span class="token punctuation">.</span><span class="token function">release</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
    <span class="token keyword">return</span> createPixelMap
  <span class="token punctuation">}</span>

  <span class="token keyword">private</span> <span class="token keyword">async</span> <span class="token function">getPixelMaps</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
    <span class="token keyword">let</span> Mypixelmaps<span class="token operator">:</span> <span class="token builtin">Array</span><span class="token operator">&lt;</span>PixelMap<span class="token operator">&gt;</span> <span class="token operator">=</span> <span class="token keyword">await</span> <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">getPixmapListFromMedia</span><span class="token punctuation">(</span><span class="token function">$r</span><span class="token punctuation">(</span><span class="token string">'app.media.icon'</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token comment">//对应资源图片为gif</span>
    <span class="token keyword">return</span> Mypixelmaps<span class="token punctuation">;</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
<div class="hljs-button {2} add_def" data-title="复制"></div></code><ul class="pre-numbering" style="opacity: 0.924133;"><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li><li style="color: rgb(153, 153, 153);">9</li><li style="color: rgb(153, 153, 153);">10</li><li style="color: rgb(153, 153, 153);">11</li><li style="color: rgb(153, 153, 153);">12</li><li style="color: rgb(153, 153, 153);">13</li><li style="color: rgb(153, 153, 153);">14</li><li style="color: rgb(153, 153, 153);">15</li><li style="color: rgb(153, 153, 153);">16</li><li style="color: rgb(153, 153, 153);">17</li><li style="color: rgb(153, 153, 153);">18</li><li style="color: rgb(153, 153, 153);">19</li><li style="color: rgb(153, 153, 153);">20</li><li style="color: rgb(153, 153, 153);">21</li><li style="color: rgb(153, 153, 153);">22</li><li style="color: rgb(153, 153, 153);">23</li><li style="color: rgb(153, 153, 153);">24</li><li style="color: rgb(153, 153, 153);">25</li><li style="color: rgb(153, 153, 153);">26</li><li style="color: rgb(153, 153, 153);">27</li><li style="color: rgb(153, 153, 153);">28</li><li style="color: rgb(153, 153, 153);">29</li><li style="color: rgb(153, 153, 153);">30</li><li style="color: rgb(153, 153, 153);">31</li><li style="color: rgb(153, 153, 153);">32</li><li style="color: rgb(153, 153, 153);">33</li><li style="color: rgb(153, 153, 153);">34</li><li style="color: rgb(153, 153, 153);">35</li><li style="color: rgb(153, 153, 153);">36</li><li style="color: rgb(153, 153, 153);">37</li><li style="color: rgb(153, 153, 153);">38</li><li style="color: rgb(153, 153, 153);">39</li><li style="color: rgb(153, 153, 153);">40</li><li style="color: rgb(153, 153, 153);">41</li><li style="color: rgb(153, 153, 153);">42</li><li style="color: rgb(153, 153, 153);">43</li><li style="color: rgb(153, 153, 153);">44</li><li style="color: rgb(153, 153, 153);">45</li><li style="color: rgb(153, 153, 153);">46</li><li style="color: rgb(153, 153, 153);">47</li><li style="color: rgb(153, 153, 153);">48</li><li style="color: rgb(153, 153, 153);">49</li><li style="color: rgb(153, 153, 153);">50</li><li style="color: rgb(153, 153, 153);">51</li></ul><button class="btn-code-notes mdeditor" data-report-click="{&quot;spm&quot;:&quot;3001.10436&quot;,&quot;extra&quot;:{&quot;index&quot;:9,&quot;runIdx&quot;:-1}}">代码解读</button></pre> 
<pre data-index="10" class="set-code-show prettyprint" style="user-select: auto;"><code class="prism language-typescript has-numbering" onclick="mdcp.copyCode(event)" style="position: unset; user-select: auto;"><span class="token comment">//	C</span>
<span class="token decorator"><span class="token at operator">@</span><span class="token function">Entry</span></span>
<span class="token decorator"><span class="token at operator">@</span><span class="token function">Component</span></span>
struct ImageExample <span class="token punctuation">{<!-- --></span>
  <span class="token function">build</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
    <span class="token function">Column</span><span class="token punctuation">(</span><span class="token punctuation">{<!-- --></span> space<span class="token operator">:</span> <span class="token number">10</span> <span class="token punctuation">}</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
      <span class="token function">Image</span><span class="token punctuation">(</span><span class="token function">$r</span><span class="token punctuation">(</span><span class="token string">'app.media.earth'</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token comment">//对应资源图片名后缀为gif</span>
        <span class="token punctuation">.</span><span class="token function">width</span><span class="token punctuation">(</span><span class="token number">100</span><span class="token punctuation">)</span>
        <span class="token punctuation">.</span><span class="token function">height</span><span class="token punctuation">(</span><span class="token number">100</span><span class="token punctuation">)</span>
    <span class="token punctuation">}</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
<div class="hljs-button {2} add_def" data-title="复制"></div></code><ul class="pre-numbering" style="opacity: 0.924133;"><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li><li style="color: rgb(153, 153, 153);">9</li><li style="color: rgb(153, 153, 153);">10</li><li style="color: rgb(153, 153, 153);">11</li><li style="color: rgb(153, 153, 153);">12</li></ul><button class="btn-code-notes mdeditor" data-report-click="{&quot;spm&quot;:&quot;3001.10436&quot;,&quot;extra&quot;:{&quot;index&quot;:10,&quot;runIdx&quot;:-1}}">代码解读</button></pre> 
<pre data-index="11" class="prettyprint set-code-show" style="user-select: auto;"><code class="prism language-typescript has-numbering" onclick="mdcp.copyCode(event)" style="position: unset; user-select: auto;"><span class="token comment">//	D</span>
<span class="token decorator"><span class="token at operator">@</span><span class="token function">Entry</span></span>
<span class="token decorator"><span class="token at operator">@</span><span class="token function">Component</span></span>
struct ImageAnimatorExample <span class="token punctuation">{<!-- --></span>
  <span class="token decorator"><span class="token at operator">@</span><span class="token function">State</span></span> iterations<span class="token operator">:</span> <span class="token builtin">number</span> <span class="token operator">=</span> <span class="token number">1</span>

  <span class="token function">build</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
    <span class="token function">Column</span><span class="token punctuation">(</span><span class="token punctuation">{<!-- --></span> space<span class="token operator">:</span> <span class="token number">10</span> <span class="token punctuation">}</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
      <span class="token function">ImageAnimator</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
        <span class="token punctuation">.</span><span class="token function">images</span><span class="token punctuation">(</span><span class="token punctuation">[</span>
          <span class="token punctuation">{<!-- --></span>
            src<span class="token operator">:</span> <span class="token function">$r</span><span class="token punctuation">(</span><span class="token string">'app media.img1'</span><span class="token punctuation">)</span>
          <span class="token punctuation">}</span><span class="token punctuation">,</span>
          <span class="token punctuation">{<!-- --></span>
            src<span class="token operator">:</span> <span class="token function">$r</span><span class="token punctuation">(</span><span class="token string">'app media.img2'</span><span class="token punctuation">)</span>
          <span class="token punctuation">}</span><span class="token punctuation">,</span>
          <span class="token punctuation">{<!-- --></span>
            src<span class="token operator">:</span> <span class="token function">$r</span><span class="token punctuation">(</span><span class="token string">'app media.img3'</span><span class="token punctuation">)</span>
          <span class="token punctuation">}</span><span class="token punctuation">,</span>
          <span class="token punctuation">{<!-- --></span>
            src<span class="token operator">:</span> <span class="token function">$r</span><span class="token punctuation">(</span><span class="token string">'app media.img4'</span><span class="token punctuation">)</span>
          <span class="token punctuation">}</span>
        <span class="token punctuation">]</span><span class="token punctuation">)</span>
        <span class="token punctuation">.</span><span class="token function">duration</span><span class="token punctuation">(</span><span class="token number">2000</span><span class="token punctuation">)</span>
        <span class="token punctuation">.</span><span class="token function">fillMode</span><span class="token punctuation">(</span>FillMode<span class="token punctuation">.</span>None<span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">iterations</span><span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">.</span>iterations<span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">width</span><span class="token punctuation">(</span><span class="token number">340</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">height</span><span class="token punctuation">(</span><span class="token number">240</span><span class="token punctuation">)</span>
        <span class="token punctuation">.</span><span class="token function">margin</span><span class="token punctuation">(</span><span class="token punctuation">{<!-- --></span> top<span class="token operator">:</span> <span class="token number">100</span> <span class="token punctuation">}</span><span class="token punctuation">)</span>
    <span class="token punctuation">}</span><span class="token punctuation">.</span><span class="token function">width</span><span class="token punctuation">(</span><span class="token string">'100%'</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">height</span><span class="token punctuation">(</span><span class="token string">'100%'</span><span class="token punctuation">)</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
<div class="hljs-button {2} add_def" data-title="复制"></div></code><ul class="pre-numbering" style="opacity: 0.924133;"><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li><li style="color: rgb(153, 153, 153);">9</li><li style="color: rgb(153, 153, 153);">10</li><li style="color: rgb(153, 153, 153);">11</li><li style="color: rgb(153, 153, 153);">12</li><li style="color: rgb(153, 153, 153);">13</li><li style="color: rgb(153, 153, 153);">14</li><li style="color: rgb(153, 153, 153);">15</li><li style="color: rgb(153, 153, 153);">16</li><li style="color: rgb(153, 153, 153);">17</li><li style="color: rgb(153, 153, 153);">18</li><li style="color: rgb(153, 153, 153);">19</li><li style="color: rgb(153, 153, 153);">20</li><li style="color: rgb(153, 153, 153);">21</li><li style="color: rgb(153, 153, 153);">22</li><li style="color: rgb(153, 153, 153);">23</li><li style="color: rgb(153, 153, 153);">24</li><li style="color: rgb(153, 153, 153);">25</li><li style="color: rgb(153, 153, 153);">26</li><li style="color: rgb(153, 153, 153);">27</li><li style="color: rgb(153, 153, 153);">28</li><li style="color: rgb(153, 153, 153);">29</li></ul><button class="btn-code-notes mdeditor" data-report-click="{&quot;spm&quot;:&quot;3001.10436&quot;,&quot;extra&quot;:{&quot;index&quot;:11,&quot;runIdx&quot;:-1}}">代码解读</button></pre> 
<p>​ <strong>A、A</strong></p> 
<p>​ <code style="user-select: auto;">B、B</code></p> 
<p>​ <code style="user-select: auto;">C、C</code></p> 
<p>​ <code style="user-select: auto;">D、D</code></p> 
<hr> 
<p>53、下面关于混淆规则描述正确的是</p> 
<p>​ A、-keep-<span class="words-blog hl-git-1" data-report-view="{&quot;spm&quot;:&quot;1001.2101.3001.10283&quot;,&quot;extra&quot;:&quot;{\&quot;words\&quot;:\&quot;global\&quot;}&quot;}" data-tit="global" data-pretit="global">global</span>-name [,idetifies,…]： 指定想保留的属性名</p> 
<p>​ <code style="user-select: auto;">B、-keep-file-name [,identifirs,...]：指定要保留的文件/文件夹的名称</code></p> 
<p>​ C、-keep-property-name [,idetifies,…]：指定要保留的顶层作用域的名称</p> 
<p>​ <code style="user-select: auto;">D、-print-namecache filepath：将名称缓存保存 到指定的文件路径。</code></p> 
<p><a href="https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/source-obfuscation-V5#%E9%85%8D%E7%BD%AE%E6%B7%B7%E6%B7%86%E8%A7%84%E5%88%99" rel="nofollow" target="_blank">代码混淆-ArkTS（方舟编程语言）-应用框架 | 华为开发者联盟 (huawei.com)</a></p> 
<hr> 
<p>54、下面关于<span class="words-blog hl-git-1" data-report-view="{&quot;spm&quot;:&quot;1001.2101.3001.10283&quot;,&quot;extra&quot;:&quot;{\&quot;words\&quot;:\&quot;Node\&quot;}&quot;}" data-tit="Node" data-pretit="node">Node</span>-API数据类型描述正确的是</p> 
<p>​ A、<code style="user-select: auto;">napi_status：是一个枚举数据类型，表示Node-API接口返回的状态信息</code></p> 
<p>​ B、napi_threadsafe_function_release_mode：该枚举类型定义了两个常量，用于指定线程安全函数的调用模式</p> 
<p>​ C、<code style="user-select: auto;">napi_env：用于表示Node-API执行时的上下文</code></p> 
<p>​ D、napi_threadsafe_function_call_mode：该枚举类型定义了两个常量，用于指定在何时释放线程安全函数的回调函数</p> 
<p><a href="https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/napi-data-types-interfaces-V5" rel="nofollow" target="_blank">Node-API支持的数据类型和接口-使用Node-API实现跨语言交互-代码开发-NDK开发 | 华为开发者联盟 (huawei.com)</a></p> 
<hr> 
<p><strong>55、以下数据类型中，哪些是Sendable数据 。（不确定）</strong></p> 
<pre data-index="12" class="set-code-show prettyprint" style="user-select: auto;"><code class="prism language-typescript has-numbering" onclick="mdcp.copyCode(event)" style="position: unset; user-select: auto;"><span class="token keyword">import</span> <span class="token punctuation">{<!-- --></span> lang <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'@kit.ArkTS'</span><span class="token punctuation">;</span>

<span class="token keyword">class</span> <span class="token class-name"><span class="token constant">C</span></span> <span class="token punctuation">{<!-- --></span><span class="token punctuation">}</span>

<span class="token keyword">interface</span> <span class="token class-name"><span class="token constant">I</span></span> <span class="token keyword">extends</span> <span class="token class-name">lang</span><span class="token punctuation">.</span>ISendable <span class="token punctuation">{<!-- --></span><span class="token punctuation">}</span>
<div class="hljs-button {2} add_def" data-title="复制"></div></code><ul class="pre-numbering" style="opacity: 0.924133;"><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li></ul><button class="btn-code-notes mdeditor" data-report-click="{&quot;spm&quot;:&quot;3001.10436&quot;,&quot;extra&quot;:{&quot;index&quot;:12,&quot;runIdx&quot;:-1}}">代码解读</button></pre> 
<p>​ <code style="user-select: auto;">A、interface I</code></p> 
<p>​ B、class C</p> 
<p>​ <code style="user-select: auto;">C、string</code></p> 
<p>​ <code style="user-select: auto;">D、number</code></p> 
<hr> 
<p>56、处于安全因素考虑，ArkTS不支持以下哪些语法。</p> 
<p>​ <code style="user-select: auto;">A、with()</code></p> 
<p>​ <code style="user-select: auto;">B、new Function('a', 'b', 'return a + b') </code></p> 
<p>​ <code style="user-select: auto;">C、eval()</code></p> 
<p>​ D、Object.entries()</p> 
<hr> 
<p>57、在ArkTS中，以下哪些声明类的方式是正确的。</p> 
<pre data-index="13" class="prettyprint set-code-show" style="user-select: auto;"><code class="prism language-typescript has-numbering" onclick="mdcp.copyCode(event)" style="position: unset; user-select: auto;"><span class="token keyword">class</span> <span class="token class-name"><span class="token constant">C1</span></span> <span class="token punctuation">{<!-- --></span>
	value<span class="token operator">:</span> <span class="token builtin">number</span> <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>

<span class="token keyword">class</span> <span class="token class-name"><span class="token constant">C2</span></span> <span class="token punctuation">{<!-- --></span>
	value<span class="token operator">:</span> <span class="token builtin">number</span><span class="token punctuation">;</span>
    
	<span class="token function">constructor</span><span class="token punctuation">(</span>value<span class="token operator">:</span> <span class="token builtin">number</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
		<span class="token keyword">this</span><span class="token punctuation">.</span>value <span class="token operator">=</span> value<span class="token punctuation">;</span>
	<span class="token punctuation">}</span>
<span class="token punctuation">}</span>

<span class="token keyword">class</span> <span class="token class-name"><span class="token constant">C3</span></span> <span class="token punctuation">{<!-- --></span>
	<span class="token function">constructor</span><span class="token punctuation">(</span>value<span class="token operator">:</span> <span class="token builtin">number</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
		<span class="token keyword">this</span><span class="token punctuation">.</span>value <span class="token operator">=</span> value<span class="token punctuation">;</span>
	<span class="token punctuation">}</span>
<span class="token punctuation">}</span>

<span class="token keyword">class</span> <span class="token class-name"><span class="token constant">C4</span></span> <span class="token punctuation">{<!-- --></span>
	value<span class="token operator">:</span> <span class="token builtin">number</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<div class="hljs-button {2} add_def" data-title="复制"></div></code><ul class="pre-numbering" style="opacity: 0.924133;"><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li><li style="color: rgb(153, 153, 153);">5</li><li style="color: rgb(153, 153, 153);">6</li><li style="color: rgb(153, 153, 153);">7</li><li style="color: rgb(153, 153, 153);">8</li><li style="color: rgb(153, 153, 153);">9</li><li style="color: rgb(153, 153, 153);">10</li><li style="color: rgb(153, 153, 153);">11</li><li style="color: rgb(153, 153, 153);">12</li><li style="color: rgb(153, 153, 153);">13</li><li style="color: rgb(153, 153, 153);">14</li><li style="color: rgb(153, 153, 153);">15</li><li style="color: rgb(153, 153, 153);">16</li><li style="color: rgb(153, 153, 153);">17</li><li style="color: rgb(153, 153, 153);">18</li><li style="color: rgb(153, 153, 153);">19</li><li style="color: rgb(153, 153, 153);">20</li><li style="color: rgb(153, 153, 153);">21</li></ul><button class="btn-code-notes mdeditor" data-report-click="{&quot;spm&quot;:&quot;3001.10436&quot;,&quot;extra&quot;:{&quot;index&quot;:13,&quot;runIdx&quot;:-1}}">代码解读</button></pre> 
<p>​ <code style="user-select: auto;">A、C1</code></p> 
<p>​ <code style="user-select: auto;">B、C2</code></p> 
<p>​ C、C3</p> 
<p>​ D、C4</p> 
<hr> 
<p>58、小华正在使用DevEco studio开发一个复杂的HarmonyOS应用，他意识到代码中有一段逻辑被多次重复使用，为了优化代码结构和减少冗余，他决定将这段逻辑提取出来作为一个独立的方法。同时，他也注意到有些常用的硬编码值可以抽象为常量，以提高代码的可读性和维护性。小华希望利用DevEco Studio的<span class="edu-hl hl hl-1" data-report-view="{&quot;spm&quot;:&quot;1001.2101.3001.7020&quot;,&quot;extra&quot;:&quot;{\&quot;word\&quot;:\&quot;代码重构\&quot;}&quot;}" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.7020&quot;,&quot;extra&quot;:&quot;{\&quot;word\&quot;:\&quot;代码重构\&quot;}&quot;}" data-tit="代码重构" data-pretit="代码重构">代码重构</span>功能来高效完成这些任务，通过以下哪些操作来实现代码重构，以提升编码效率</p> 
<p>​ <code style="user-select: auto;">A、为了简化复杂类型的多次书写，小华可以选择特定类型字面量，通过“Refactor”菜单下的“Extract Type Alias”来创建类型别名</code></p> 
<p>​ <code style="user-select: auto;">B、若需要将局部变量提升为类成员变量，小华只需简单选中变量名，右键选择“Refactor” -&gt; “Promote Local Variable”</code></p> 
<p>​ <code style="user-select: auto;">C、选中需要重构的代码块，右键点击选择“Refactor”，然后选择“Extract Method”来将代码块转换为一个新的函数/方法</code></p> 
<p>​ <code style="user-select: auto;">D、如果小华识别到一 组相关的对象字面值可以抽象为一个接口，他可以直接通过“Refactor”菜单中的“Extract Interface”功能实现</code></p> 
<hr> 
<p>59、哪些是持续集成最佳实践？</p> 
<p>​ <code style="user-select: auto;">A、自动化构建：确保构建过程是完全自动化的，减少人为错误。</code></p> 
<p>​ B、构建相同代码的 Pipeline 运行多次，得到结果不同。比如，基于同一代码基线，一条Pipeline构建了5次，只要最后一次通过即可。</p> 
<p>​ <code style="user-select: auto;">C、全面的测试套件：包括单元测试、集成测试、功能测试等，以提高代码质量。</code></p> 
<p>​ D、通常项目上会有一 个专职 Ops，在项目可以发布的时候手动触发部署流程，或者需要传递很多参数，让 Pipeline 运行起来。</p> 
<p>​ <code style="user-select: auto;">E、频繁提交代码：鼓励开发人员经常提交小的代码更改， 以便更快地发现问题。</code></p> 
<p>​ <code style="user-select: auto;">F、代码审查：在集成前进行代码审查，及时发现潜在问题。</code></p> 
<p>​ <code style="user-select: auto;">G、快速反馈机制：让开发人员能迅速得知集成结果和测试状态。</code></p> 
<hr> 
<p><strong>60、下面代码符合ArkTS编程规范的是（不确定，把所有选项列出）</strong></p> 
<pre data-index="14" class="set-code-show prettyprint" style="user-select: auto;"><code class="prism language-typescript has-numbering" onclick="mdcp.copyCode(event)" style="position: unset; user-select: auto;"><span class="token keyword">let</span> maxCount <span class="token operator">=</span> <span class="token number">10</span><span class="token punctuation">,</span> isCompleted <span class="token operator">=</span> <span class="token boolean">false</span><span class="token punctuation">;</span>
<span class="token comment">//	不能像Java这样定义变量</span>
<span class="token keyword">let</span> pointX<span class="token punctuation">,</span> pointY<span class="token punctuation">;</span>
pointx <span class="token operator">=</span> <span class="token number">10</span><span class="token punctuation">;</span> pointY <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>
<div class="hljs-button {2} add_def" data-title="复制"></div></code><ul class="pre-numbering" style="opacity: 0.924133;"><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li></ul><button class="btn-code-notes mdeditor" data-report-click="{&quot;spm&quot;:&quot;3001.10436&quot;,&quot;extra&quot;:{&quot;index&quot;:14,&quot;runIdx&quot;:-1}}">代码解读</button></pre> 
<pre data-index="15" class="set-code-show prettyprint" style="user-select: auto;"><code class="prism language-typescript has-numbering" onclick="mdcp.copyCode(event)" style="position: unset; user-select: auto;"><span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">let</span> idx <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> idx <span class="token operator">&lt;</span> <span class="token number">5</span><span class="token punctuation">;</span> <span class="token operator">++</span>idx<span class="token punctuation">)</span>
    <span class="token comment">// console.log(【string】类型)</span>
	<span class="token builtin">console</span><span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span>idx<span class="token punctuation">)</span><span class="token punctuation">;</span>
<div class="hljs-button {2} add_def" data-title="复制"></div></code><ul class="pre-numbering" style="opacity: 0.924133;"><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li></ul><button class="btn-code-notes mdeditor" data-report-click="{&quot;spm&quot;:&quot;3001.10436&quot;,&quot;extra&quot;:{&quot;index&quot;:15,&quot;runIdx&quot;:-1}}">代码解读</button></pre> 
<pre data-index="16" class="set-code-show prettyprint" style="user-select: auto;"><code class="prism language-typescript has-numbering" onclick="mdcp.copyCode(event)" style="position: unset; user-select: auto;"><span class="token keyword">let</span> maxCount <span class="token operator">=</span> <span class="token number">10</span><span class="token punctuation">;</span>
<span class="token keyword">let</span> isCompleted <span class="token operator">=</span> <span class="token boolean">false</span><span class="token punctuation">;</span>
<span class="token keyword">let</span> pointX <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>
<span class="token keyword">let</span> pointY <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>
<div class="hljs-button {2} add_def" data-title="复制"></div></code><ul class="pre-numbering" style="opacity: 0.924133;"><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li></ul><button class="btn-code-notes mdeditor" data-report-click="{&quot;spm&quot;:&quot;3001.10436&quot;,&quot;extra&quot;:{&quot;index&quot;:16,&quot;runIdx&quot;:-1}}">代码解读</button></pre> 
<pre data-index="17" class="set-code-show prettyprint" style="user-select: auto;"><code class="prism language-typescript has-numbering" onclick="mdcp.copyCode(event)" style="position: unset; user-select: auto;"><span class="token comment">//	没有定义【condition】</span>
<span class="token keyword">if</span> <span class="token punctuation">(</span>condition<span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
	<span class="token builtin">console</span><span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span><span class="token string">'success'</span><span class="token punctuation">)</span><span class="token punctuation">;</span> 
<span class="token punctuation">}</span>
<div class="hljs-button {2} add_def" data-title="复制"></div></code><ul class="pre-numbering" style="opacity: 0.924133;"><li style="color: rgb(153, 153, 153);">1</li><li style="color: rgb(153, 153, 153);">2</li><li style="color: rgb(153, 153, 153);">3</li><li style="color: rgb(153, 153, 153);">4</li></ul><button class="btn-code-notes mdeditor" data-report-click="{&quot;spm&quot;:&quot;3001.10436&quot;,&quot;extra&quot;:{&quot;index&quot;:17,&quot;runIdx&quot;:-1}}">代码解读</button></pre> 
<p>​ <strong>A、A</strong></p> 
<p>​ <strong>B、B</strong></p> 
<p>​ <code style="user-select: auto;">C、C</code></p> 
<p>​ <code style="user-select: auto;">D、D</code></p> 
<hr> 
<p>61、下面关于ArkTS中export用法，正确的是</p> 
<p>​ <code style="user-select: auto;">A、export { export1 as alias1 } from "ets file name";</code></p> 
<p>​ <code style="user-select: auto;">B、export * as name from "ets file name"</code></p> 
<p>​ <code style="user-select: auto;">C、export * from "ets file name"</code></p> 
<p>​ <code style="user-select: auto;">D、export { export1 } from "ets file name";</code></p> 
<hr> 
<p><strong>62、在使用DevEco Studio进行HarmonyOS应用开发和调试过程中，开发者小张遇到应用运行时意外终止的情况，他需要快速定位并解决导致应用崩溃的问题。以下哪些做法可以帮助小张有效分析和处理这些问题（不确定，把所有选项列出）</strong></p> 
<p>​ <code style="user-select: auto;">A、查看DevEco Studio log工具栏输出的错误日志，根据日志提示分析应用崩溃的具体原因及代码位置</code></p> 
<p>​ <code style="user-select: auto;">B、若遇到App运行卡顿或系统整体无响（(App Freeze, System Freeze）的情况，可以通过性能分析工具中的Frame Insight和Allocation Insight功能，分析应用的资源消耗情况，寻找可能的瓶颈</code></p> 
<p>​ <strong>C、当怀疑问题是由于C++代码中的内存错误（如数组越界、内存泄露、重复释放内存）引起时，进入“Run/Debug Configurations"设置界面，勾选启用Address Sanitizer (ASan),然后重新部署应用进行测试以获取更详细的内存问题报告</strong></p> 
<p><strong>D、利用系统自动生成的FaultLog，包括App Freeze、 CPP Crash、 JS Crash、 System Freeze和ASan报告， 这些报告会详细记录故障发生时的环境、堆栈信息和可能的故障原因，是排查问题的重要参考</strong></p> 
<hr> 
<p>63、为了加快构建速度，提高开发效率，可以如何调整hvigor配置，从而优化构建速度</p> 
<p>​ <code style="user-select: auto;">A、启用hvigor的incremental，在增量场景下检查任务是否可以跳过</code></p> 
<p>​ <code style="user-select: auto;">B、启动hvigor的daemon模式，在增量场景下复用缓存</code></p> 
<p>​ C、启用hvigor的typeCheck，在增量场景下进行对higorfile.ts进行类型检查</p> 
<p>​ <code style="user-select: auto;">D、启用hvigor的parallel，在增量场景下进行并行编译处理</code></p> 
<p><a href="https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/ide-hvigor-improve-performance-0000001731595128-V5" rel="nofollow" target="_blank">提高hvigor构建性能-优化构建性能-优化构建-编译构建-DevEco Studio | 华为开发者联盟 (huawei.com)</a></p> 
<hr> 
<p>64、项目组开发的HarmonyOS应用工程，为了保护hap代码资产，如何在DevEco Studio中启用混淆的功能，并设置相应的混淆规则？</p> 
<p>​ <code style="user-select: auto;">A、在混淆规则配置文件obfuscation-rules.txt中进行混淆规则的配置</code></p> 
<p>​ <code style="user-select: auto;">B、release模式下将buildOption/arkOptions/ruleOptions/enable设置为true</code></p> 
<hr> 
<p>65、Navigation<span class="edu-hl hl hl-1" data-report-view="{&quot;spm&quot;:&quot;1001.2101.3001.7020&quot;,&quot;extra&quot;:&quot;{\&quot;word\&quot;:\&quot;组件\&quot;}&quot;}" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.7020&quot;,&quot;extra&quot;:&quot;{\&quot;word\&quot;:\&quot;组件\&quot;}&quot;}" data-tit="组件" data-pretit="组件">组件</span>是路由导航的根视图容器，一般作为Page页面的根容器使用，以下关于Navigation组件说法正确的是</p> 
<p>​ <code style="user-select: auto;">A、Navigation的子页面可以来自不同的Module</code></p> 
<p>​ <code style="user-select: auto;">B、Navigation的页面显示模式有单页面、分栏和自适应三种显示模式</code></p> 
<hr> 
<p><strong>66、开发者小李正在使用DevEco Studio开发一款面向HarmonyOS的应用，该应用需要在多种设备上表现出一致的稳定性和优秀的用户体验。为了确保高质量的发布，小李意识到需要实施一套全面的测试策略，覆盖代码的自动化测试和手动测试，还需要衡量代码的测试覆盖率，以确定测试的充分性。在DevEco Studio的测试框架下，以下描述中，哪些是正确的（不确定）</strong></p> 
<pre data-index="18" class="set-code-show prettyprint" style="user-select: auto;"><code class="has-numbering" onclick="mdcp.copyCode(event)" style="position: unset; user-select: auto;">不选这一项，其余全选：【Instrument Test：测试用例存储于项目的ohosTest目录，要求在HarmonyOS设备或模拟器上执行，兼容ArkTS与JS语言编写。】
<div class="hljs-button {2} add_def" data-title="复制"></div></code><ul class="pre-numbering" style="opacity: 0.924133;"><li style="color: rgb(153, 153, 153);">1</li></ul><button class="btn-code-notes mdeditor" data-report-click="{&quot;spm&quot;:&quot;3001.10436&quot;,&quot;extra&quot;:{&quot;index&quot;:18,&quot;runIdx&quot;:-1}}">代码解读</button></pre> 
<hr>
                